package com.xu.demo.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xu.demo.common.R;
import com.xu.demo.entity.Gt;
import com.xu.demo.entity.Post;
import com.xu.demo.service.GtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/gt")
public class GtController {
    @Autowired
    private GtService gtService;
    @GetMapping("/{tz_id}")
    public Page<Gt> detail(@PathVariable Integer tz_id){
        Page pageInfo=new Page(1,5);
        LambdaQueryWrapper<Gt> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(Gt::getTz_id,tz_id.longValue());
        Page<Gt> gts=gtService.page(pageInfo,queryWrapper);
        return gts;
    }
}
